package com.whl.sm.vo;

import com.whl.sm.model.assets.ComUnits;
import com.whl.sm.model.expense.TenancyBill;
import com.whl.sm.model.system.OrgUserInfo;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class TenancyBillVo implements Serializable {

    public TenancyBillVo(TenancyBill tenancyBill, ComUnits comUnits, OrgUserInfo user){
        if (tenancyBill != null){
            this.id = tenancyBill.getId();
            this.billPrice = tenancyBill.getBillPrice();
            this.billMonth = tenancyBill.getBillMonth();
            this.paymentStatus = tenancyBill.getPaymentStatus();
            this.paymentTime = tenancyBill.getPaymentTime();
            this.operator = tenancyBill.getOperator();
            this.createTime = tenancyBill.getCreateTime();
            this.updateTime = tenancyBill.getUpdateTime();
        }
        if (comUnits != null){
            this.unitId = comUnits.getId();
            this.unitCode = comUnits.getUnitCode();
        }
        if( user != null){
            this.payer = user.getUserId();
            this.payerName = user.getUserName();
        }
    }



    private String id;
    /**
     * 单元Id
     */
    private String unitId;

    /**
     * 单元编号
     */
    private String unitCode;


    /**
     * 账单金额
     */
    private Double billPrice;

    /**
     * 账单月份
     */
    private String billMonth;

    /**
     * 支付状态 1：已支付  2：未支付
     */
    private Integer paymentStatus;

    /**
     * 支付者
     */
    private String payer;

    /**
     * 支付者名称
     */
    private String payerName;

    /**
     * 支付时间
     */
    private Date paymentTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 操作者
     */
    private String operator;
}
